[#import "/framework/JGP.htm"  as JGP]
<!--
项目   jgp-cloud-parent
作者   LOUFEI [Gavin]
时间   2019/4/1
-->
[@JGP.head "编辑任务"/]
[@JGP.body]
<jgp-div _row="['30','*']" _runit="px">
    <div slot="1-1">
        <jgp-btn _form="job-form" _fn="callbackFn">保存</jgp-btn>
    </div>
    <jgp-form slot="2-1" _id="job-form" _action="/timing/job-api-ctl/${(jobId?exists)?string('update-job','create-job')}">
        <jgp-form-group _title="描述">
            <jgp-text _label="任务名称" _name="name" _col="12" _required="true"></jgp-text>
            <jgp-area _label="说明" _name="remark"  _required="true"></jgp-area>
        </jgp-form-group>
        <jgp-form-group _title="参数">
            <jgp-text _label="表达式" _name="cron" _col="12" _required="true" _placeholder="cron 表达式"></jgp-text>
            <jgp-drop
                    _required="true"
                    _label="调用类型"
                    _col="12"
                    _name="type"
                    _not_input="true"
                    _list="[{'label':'URL','value':'URL'},
                    {'label':'本地方法调用','value':'SERVICE'}]"></jgp-drop>
            <jgp-text  _required="true" _label="目标" _name="target" _col="12"></jgp-text>
        </jgp-form-group>
    </jgp-form>
</jgp-div>
[/@JGP.body]

[@JGP.foot]
<script>
    [#if jobId?exists]
        JGP.$onload(function(){
            JGP.$post('/timing/job-api-ctl/query-job',{
                jobId:'${jobId}'
            },function (result) {
                JGP.form('job-form').setFdata(result.data.fdata);
            })
        })
    [/#if]

    function callbackFn() {
        JGP.$close(true);
    }
</script>
[/@JGP.foot]